<!DOCTYPE html>
<html lang="en" xmlns:v-model="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>练习2</title>
</head>
<body>
<div id="app">
    <h1>{{message}}</h1>
    书名: <input type="text" v-model="book.name">
    <button @click="show">{{button.name}}</button>
</div>
<script src="vue.js"></script>
<script>
    let vm = new Vue({
        el: "#app",
        data: {
            message: "演示Vue事件绑定操作",
            book: {name: "笑傲江湖"},
            button: {name: "点击显示输入框的内容"}
        },
        methods: {
            show() {
                alert(this.book.name);
            }
        }
    })
</script>
</body>
</html>